def manual_iter():
    with open(r'/etc/passwd') as f:
        while True:
            line = next(f, None) # 使用 next() 函数,仅读取1行
            if line is None:
                break
            print(line, end='')


items = [1,2,3]
it = iter(items)
print(next(it))
print(next(it))
print(next(it))
print(next(it)) # raise StopIteration